<%@ page import="org.bjou.ShiroUser" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="pertho">
		<g:set var="entityName" value="${message(code: 'shiroUser.label', default: 'ShiroUser')}" />
		<title><g:message code="default.create.label" args="[entityName]" /></title>
	</head>
	<body>
<div class="container">
    <div class="row">
      <div class="twelve columns">
        <div class="box_c">
          <div class="box_c_heading cf">
            <p><g:message code="default.create.label" args="[entityName]" /></p>
          </div>
          <div class="box_c_content">
              <!-- start -->
		<div id="create-shiroUser" class="content scaffold-create" role="main">
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${shiroUserInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${shiroUserInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			<g:form action="save" >
				<fieldset class="form">
							<div class="fieldcontain ${hasErrors(bean: shiroUserInstance, field: 'username', 'error')} required">
	<label for="username">
		<g:message code="shiroUser.username.label" default="用户名" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="username" required="" value="${shiroUserInstance?.username}"/>
</div>
                                  
                                  
                                  <div class="fieldcontain required">
	<label for="username">
		姓名
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="fullname" required="" />
</div>

                                  <!--
<div class="fieldcontain ${hasErrors(bean: shiroUserInstance, field: 'passwordHash', 'error')} ">
	<label for="passwordHash">
		<g:message code="shiroUser.passwordHash.label" default="密码" />
		
	</label>
	<g:passwordField name="passwordHash" value="${shiroUserInstance?.passwordHash}"/>
</div>
                                  -->



<div class="fieldcontain ${hasErrors(bean: shiroUserInstance, field: 'roles', 'error')} ">
	<label for="roles">
		<g:message code="shiroUser.roles.label" default="角色" />
		
	</label>
	<g:select name="roleId" from="${org.bjou.ShiroRole.list()}"   optionKey="id" optionValue="name" 
                          class="many-to-one" noSelection="['': '请选择']" value="${roleId}" />
</div>
				</fieldset>
				<fieldset class="buttons">
					<g:submitButton name="create" class="gh_button" value="${message(code: 'default.button.create.label', default: 'Create')}" />
				 <g:link class="gh_button list" action="list">返回用户列表</g:link>
                                </fieldset>
                        </g:form>
		  <!-- end -->
            </div>
          </div>
        </div>
      </div>
    </div>
	</body>
</html>
